package ru.study.thinkin.chapter9.interfaceprocessor;

import ru.study.thinkin.chapter9.BandPass;
import ru.study.thinkin.chapter9.Filter;
import ru.study.thinkin.chapter9.LowPass;
import ru.study.thinkin.chapter9.WaveForm;

public class FilterAdapter implements ProcessorInt {
	Filter filter;

	public FilterAdapter(Filter filter) {
		this.filter = filter;
	}

	public WaveForm processor(Object input) {
		return filter.process((WaveForm) input);
	}

	public String name() {
		return filter.name();
	}

	public Object process(Object input) {
		return filter.process((WaveForm) input);
	}

	public static void main(String[] args) {
		WaveForm w = new WaveForm();
		ApplyInt.process(new FilterAdapter(new LowPass(1.0)), w);
		ApplyInt.process(new FilterAdapter(new BandPass(3.0, 4.0)), w);
		ApplyInt.process(new Upcase(), "qwerty");
	}
}
